package com.example.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class Result<T> {
    private int code;
    private T data;

    public static <T> Result<T> error(T data) {
        return new Result<T>(0, data);//失败
    }

    public static <T> Result<T> success(T data) {
        return new Result<T>(1, data);//成功
    }


}
